/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sql;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

/**
 *
 * @author 马凯
 */
public class INSERT_SQL {
private static INSERT_SQL ss;
    private Statement statement;
    
    public INSERT_SQL(){

    }
    
    public static INSERT_SQL getInstance(){
        if(ss==null){
            ss = new INSERT_SQL();
        }
        return ss;
    }
    
    public void run(String sqlQuery){
        try {
            Class.forName("com.mysql.jdbc.Driver");
            Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1:3306/isc?user=root&password=root");
            con.setCatalog("isc");
            statement = con.createStatement();

            statement.executeQuery(sqlQuery);
        }catch(Exception e){
            e.printStackTrace();
        }
        /*catch(ClassNotFoundException e){
            e.printStackTrace();
            return null;
        }*/
        /*catch(SQLException sql){
            sql.printStackTrace();
            return null;
        }*/
    }
}
